package com.xiao.hao.enums;


import cn.hutool.core.collection.CollUtil;
import com.xiao.hao.resp.BaseEnums;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

@Getter
@AllArgsConstructor
public enum ProcessEnum {

    Process_1("1", "思考过程"),
    Process_2("2", "关键点"),
    Process_3("3", "详细报告"),
    Process_4("4", "1. 常见原因分析"),
    Process_5("5", "2. 科学干预方案或提升策略"),
    Process_6("6", "3. 7天周期化调整方案（智能表格）");

    private final String code;
    private final String name;

    public static String getNameByValue(String code) {
        for (ProcessEnum typeEnum : values()) {
            if (typeEnum.getCode().equals(code)) {
                return typeEnum.getName();
            }
        }
        return null;
    }

    public static List<BaseEnums> getEnumRespList() {
        List<BaseEnums> respList = CollUtil.newArrayList();
        for (ProcessEnum baseUnitEnum : values()) {
            respList.add(new BaseEnums(baseUnitEnum.getCode(), baseUnitEnum.getName()));
        }
        return respList;
    }


}
